package com.it.zhangjun.arithmetic.递归;

/**
 * 上楼梯
 *
 * @author jun.zhang6
 * @date 2020/10/26
 */
public class ClimbStair {
    public static void main(String[] args) {
        System.out.println(climbStair1(5));
    }

    public static int climbStair1(int n) {
        if (n <= 2) {
            return n;
        }
        return climbStair1(n - 1) + climbStair1(n - 2);
    }
}
